]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar: Disconnect signals when resetting notification
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 23 Nov 2018 15:22:45 +0000 (16:22 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 16 Jan 2019 17:46:09 +0000 (17:46 +0000)
Since commit 5fb8d4f730, a NotificationMessage's notification property
is reset to null when the notification is destroyed. However at that
point we still have connected signal handlers around that we'll try
to disconnect later.

Avoid the warnings by disconnecting and resetting the handler IDs at
the same time as the notification.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/308

js/ui/calendar.js

index c4d3625374fb94656fcd398eb0f18d4ee4435f6d..dfe1bb9482573c9ba4dab1abdb89fee2b289d178 100644 (file)
@@ -779,6 +779,7 @@ var NotificationMessage = new Lang.Class({
                 this.notification.destroy(MessageTray.NotificationDestroyedReason.DISMISSED);
         });
         this._destroyId = notification.connect('destroy', () => {
+            this._disconnectNotificationSignals();
             this.notification = null;
             if (!this._closed)
                 this.close();
@@ -808,7 +809,10 @@ var NotificationMessage = new Lang.Class({
 
     _onDestroy() {
         this.parent();
+        this._disconnectNotificationSignals();
+    },
 
+    _disconnectNotificationSignals() {
         if (this._updatedId)
             this.notification.disconnect(this._updatedId);
         this._updatedId = 0;